<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<base href="<%=basePath%>" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>新增实验室</title>
<link href="static/css/style.css" rel="stylesheet" type="text/css" />
<link href="static/css/select.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="static/js/jquery.js"></script>
<script type="text/javascript" src="static/js/jquery.idTabs.min.js"></script>
<script type="text/javascript" src="static/js/select-ui.min.js"></script>
<script type="text/javascript" src="static/editor/kindeditor.js"></script>

<script type="text/javascript">	

</script>

<script type="text/javascript">
    KE.show({
        id : 'content7',
        cssPath : './index.css'
    });
</script> 
<script type="text/javascript">
$(document).ready(function(e) {
    $(".select1").uedSelect({
		width : 345			  
	});
	$(".select2").uedSelect({
		width : 167  
	});
	$(".select3").uedSelect({
		width : 100
	});
});
</script>
<script type="text/javascript">
	window.onload=function(){

		$("#ldi").attr("value", ${updateLaboratory.department.id});
		
		$("#deptList").change(function(){
			$("#ldi").attr("value", $("#deptList").val());
		});
		
	};
</script>
<script type="text/javascript">
$(function(){   
	$('#createLab').click(function() {
			var labName = $('#labName').val();
			var labSeatNum = $('#labSeatNum').val();
			if (labName == '') {
				alert('实验室名称不能为空！');
				return false;
			} 
			if (labSeatNum == '') {
				alert('座位数不能为空！');
				return false;
			} 
			$('#addLaboratoryForm').submit();
		});
	});
</script>
</head>

<body>

	<div class="place">
    <span>位置：</span>
    <ul class="placeul">
    <li><a href="PageFrame_index.action">首页</a></li>
    </ul>
    </div>
    
    <div class="formbody">
    
    
    <div id="usual1" class="usual"> 
    
    <div class="itab">
  	<ul> 
    <li><a href="#tab1" class="selected">新增实验室</a></li> 
  	</ul>
    </div> 
    
    <form name="addLaboratoryForm" action="Laboratory_doUpdate" method="post">
  	<div id="tab1" class="tabson">
    
    <div class="formtext">Hi，<b>${user.userName}</b>，欢迎您试用新增实验室功能！</div>
    
    <ul class="forminfo">
    <li><label>部门名称<b>*</b></label>     
    <div class="vocation">
    	<!-- 如果使用 select1 可能导致取不到值-->
    	<select id="deptList" name="test" class="select2">
    	<c:forEach items="${departments}" var="department">
    	<c:choose >
    		<c:when test="${department.id==updateLaboratory.department.id}">
    		<option value="${department.id}" selected="selected"> ${department.deptName} </option>
    		</c:when>
    		<c:otherwise>
    		<option value="${department.id}"> ${department.deptName} </option>
    		</c:otherwise>   		
    	</c:choose>
    	
    	</c:forEach>
	    </select>
	    </div> 
    </li>
    <li><input type="hidden" id="ldi" name="laboratory.department.id" value=""/>  </li>     
    <li><label>实验室名称<b>*</b></label><input id="labName" name="laboratory.labName" type="text" class="dfinput" value="${updateLaboratory.labName}"  /></li>
 	<li><label>座位数<b>*</b></label><input id="labSeatNum" name="laboratory.labSeatNum" type="text" class="dfinput" value="${updateLaboratory.labSeatNum}"  /></li>
    <li><label>描述<b>*</b></label>
    <textarea id="content7" name="laboratory.labDesc" style="width:700px;height:250px;visibility:hidden;">${updateLaboratory.labDesc}</textarea>  
    </li>
    
    <li><input type="hidden" name="laboratory.id" type="text" class="dfinput" value="${updateLaboratory.id}"  style="width:250px;"/></li>
   	<li><input type="hidden" name="laboratory.createDate" type="text" class="dfinput" value="${updateLaboratory.createDate}"  style="width:250px;"/></li>
   	<li><input type="hidden" name="laboratory.createUserName" type="text" class="dfinput" value="${updateLaboratory.createUserName}"  style="width:250px;"/></li>
   	
    <li><label>&nbsp;</label><input id="createLab" name="" type="submit" class="btn" value="马上更新"/></li>
    </ul>
    
    </div> 
    </form>
    
	</div> 
 
	<script type="text/javascript"> 
      $("#usual1 ul").idTabs(); 
    </script>
    
    <script type="text/javascript">
	$('.tablelist tbody tr:odd').addClass('odd');
	</script>
    
    
    
    
    
    </div>


</body>

</html>
